package com.lunz.machine.adapter;

import android.content.Context;

import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class CheckCarPageAdapter extends FragmentPagerAdapter {
    private Context mContext;
    private List<Fragment> fragmentList;
    private String[] title;

    public CheckCarPageAdapter(FragmentManager fm, Context context, List<Fragment> fragmentList, String[] title) {
        super(fm);
        this.mContext = context;
        this.fragmentList = fragmentList;
        this.title = title;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }

    @Override
    public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
//        super.destroyItem(container, position, object);
    }
}
